The present invention relates to computer programs to assist in the preparation and maintenance of software and, in particular, to a search utility that may provide searches of computer programs based on an example fragment of a computer program.
Industrial controllers are special-purpose computers used for the real-time control of factory automation and the like. In operation, such controllers read a series of inputs from sensors associated with the automation and, based on an internal control program and those inputs, provide outputs to actuators controlling the automation.
In contrast to standard computers, industrial controllers are designed to be readily adaptable to a wide variety of different applications reflecting different control tasks. For this purpose, the hardware of industrial controllers is typically modular allowing changes in number and configurations of input and output circuits for communicating with the factory automation. High-speed and deterministic communication networks permit spatial distribution of the components of the industrial controller, including input and output modules providing the interface circuits, at a variety of locations consistent with their need to communicate with an industrial process that may occupy an entire factory.
Adapting an industrial controller to a specialized control task often requires the preparation of a custom program. For this reason, specialized control languages have been developed that simplify control program development including relay-ladder language (RLL) or structured block programming. These languages incorporate graphic elements (such as contacts or functional blocks) with text labels and a simplified control-flow to facilitate troubleshooting of the program.
The large capital investment represented by a typical factory and its industrial controllers normally requires operation of the factory over many years during which time maintenance of the control program will be required. To this end, software engineers may use search utilities to search through written control programs to help identify program elements that need revision or inspection during the maintenance process. Such search utilities generally look for a pattern in an underlying text version of the graphical programming languages. The search pattern may be expressed as a complex structural query, for example, using the SPARQL language, as disclosed in US patent application 2010/0153412 “User Interface and Methods for Building Structural Queries” filed Dec. 15, 2008 and US Patent Application 2010/0082669 “System and Method for Retrieving and Storing Industrial Data” filed Sep. 30, 2008, both assigned to the present assignee and hereby incorporated by reference. Such searches can be directed to any program element including a program instruction or data variable.
Such “expression” searches may be helpful in identifying everywhere a particular input variable or output variable is used in the control program. Expression searches may also be useful for identifying particular sequences of instructions, but formulation of the search query is difficult and this may deter usage of the utilities in this context.